%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for queries/functions/computed-column-scalar"
    Bucket0("Bucket 0 (root)<br /><br />1: 42, 47, 52<br />ᐳ: 8, 9, 14, 56, 57, 58, 10, 41, 46, 51<br />2: PgSelect[7]<br />ᐳ: Access[43], Access[48], Access[53]<br />3: PgSelectRows[12]<br />ᐳ: First[11], PgSelectSingle[13]"):::bucket
    Bucket1("Bucket 1 (nullableBoundary)<br />Deps: 43, 13, 48, 53<br /><br />ROOT PgSelectSingleᐸforumsᐳ[13]<br />1: <br />ᐳ: 44, 49, 54, 45, 50, 55<br />2: 22, 30, 38<br />ᐳ: 21, 23, 24, 29, 31, 32, 37, 39, 40"):::bucket
    end
    Bucket0 --> Bucket1

    %% plan dependencies
    PgSelect7[["PgSelect[7∈0] ➊<br />ᐸforumsᐳ<br />More deps:<br />- Constantᐸ'f1700000-0000-0000-0000-000000000f17'ᐳ[56]"]]:::plan
    Object10{{"Object[10∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    PgFromExpression41{{"PgFromExpression[41∈0] ➊<br />More deps:<br />- Constantᐸundefinedᐳ[14]"}}:::plan
    PgSelectInlineApply42["PgSelectInlineApply[42∈0] ➊"]:::plan
    PgFromExpression46{{"PgFromExpression[46∈0] ➊<br />More deps:<br />- Constantᐸtrueᐳ[57]"}}:::plan
    PgSelectInlineApply47["PgSelectInlineApply[47∈0] ➊"]:::plan
    PgFromExpression51{{"PgFromExpression[51∈0] ➊<br />More deps:<br />- Constantᐸfalseᐳ[58]"}}:::plan
    PgSelectInlineApply52["PgSelectInlineApply[52∈0] ➊"]:::plan
    Object10 & PgFromExpression41 & PgSelectInlineApply42 & PgFromExpression46 & PgSelectInlineApply47 & PgFromExpression51 & PgSelectInlineApply52 --> PgSelect7
    Access8{{"Access[8∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
    Access9{{"Access[9∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
    Access8 & Access9 --> Object10
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
    __Value2 --> Access8
    __Value2 --> Access9
    First11{{"First[11∈0] ➊"}}:::plan
    PgSelectRows12[["PgSelectRows[12∈0] ➊"]]:::plan
    PgSelectRows12 --> First11
    PgSelect7 --> PgSelectRows12
    PgSelectSingle13{{"PgSelectSingle[13∈0] ➊<br />ᐸforumsᐳ"}}:::plan
    First11 --> PgSelectSingle13
    Access43{{"Access[43∈0] ➊<br />ᐸ7.m.joinDetailsFor16ᐳ"}}:::plan
    PgSelect7 --> Access43
    Access48{{"Access[48∈0] ➊<br />ᐸ7.m.joinDetailsFor26ᐳ"}}:::plan
    PgSelect7 --> Access48
    Access53{{"Access[53∈0] ➊<br />ᐸ7.m.joinDetailsFor34ᐳ"}}:::plan
    PgSelect7 --> Access53
    List44{{"List[44∈1] ➊<br />ᐸ43,13ᐳ"}}:::plan
    Access43 & PgSelectSingle13 --> List44
    List49{{"List[49∈1] ➊<br />ᐸ48,13ᐳ"}}:::plan
    Access48 & PgSelectSingle13 --> List49
    List54{{"List[54∈1] ➊<br />ᐸ53,13ᐳ"}}:::plan
    Access53 & PgSelectSingle13 --> List54
    First21{{"First[21∈1] ➊"}}:::plan
    PgSelectRows22[["PgSelectRows[22∈1] ➊"]]:::plan
    PgSelectRows22 --> First21
    Lambda45{{"Lambda[45∈1] ➊<br />ᐸpgInlineViaJoinTransformᐳ"}}:::plan
    Lambda45 --> PgSelectRows22
    PgSelectSingle23{{"PgSelectSingle[23∈1] ➊<br />ᐸforums_unique_author_countᐳ"}}:::plan
    First21 --> PgSelectSingle23
    PgClassExpression24{{"PgClassExpression[24∈1] ➊<br />ᐸ__forums_u..._count__.vᐳ"}}:::plan
    PgSelectSingle23 --> PgClassExpression24
    First29{{"First[29∈1] ➊"}}:::plan
    PgSelectRows30[["PgSelectRows[30∈1] ➊"]]:::plan
    PgSelectRows30 --> First29
    Lambda50{{"Lambda[50∈1] ➊<br />ᐸpgInlineViaJoinTransformᐳ"}}:::plan
    Lambda50 --> PgSelectRows30
    PgSelectSingle31{{"PgSelectSingle[31∈1] ➊<br />ᐸforums_unique_author_countᐳ"}}:::plan
    First29 --> PgSelectSingle31
    PgClassExpression32{{"PgClassExpression[32∈1] ➊<br />ᐸ__forums_u..._count__.vᐳ"}}:::plan
    PgSelectSingle31 --> PgClassExpression32
    First37{{"First[37∈1] ➊"}}:::plan
    PgSelectRows38[["PgSelectRows[38∈1] ➊"]]:::plan
    PgSelectRows38 --> First37
    Lambda55{{"Lambda[55∈1] ➊<br />ᐸpgInlineViaJoinTransformᐳ"}}:::plan
    Lambda55 --> PgSelectRows38
    PgSelectSingle39{{"PgSelectSingle[39∈1] ➊<br />ᐸforums_unique_author_countᐳ"}}:::plan
    First37 --> PgSelectSingle39
    PgClassExpression40{{"PgClassExpression[40∈1] ➊<br />ᐸ__forums_u..._count__.vᐳ"}}:::plan
    PgSelectSingle39 --> PgClassExpression40
    List44 --> Lambda45
    List49 --> Lambda50
    List54 --> Lambda55

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,PgSelect7,Access8,Access9,Object10,First11,PgSelectRows12,PgSelectSingle13,PgFromExpression41,PgSelectInlineApply42,Access43,PgFromExpression46,PgSelectInlineApply47,Access48,PgFromExpression51,PgSelectInlineApply52,Access53 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1,First21,PgSelectRows22,PgSelectSingle23,PgClassExpression24,First29,PgSelectRows30,PgSelectSingle31,PgClassExpression32,First37,PgSelectRows38,PgSelectSingle39,PgClassExpression40,List44,Lambda45,List49,Lambda50,List54,Lambda55 bucket1

